/* posts页面专用样式 */

/* 返回首页按钮样式 */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 优化帖子容器样式，使其更像小红书 */
.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* 修改post-item样式，使其更像小红书卡片 */
.post-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 优化视频容器样式，解决视频帖子太扁的问题 */
.posts-container .video-container {
    width: 100%;
    height: 250px;
    border-radius: 0; /* 与卡片圆角一致，无需单独设置 */
    overflow: hidden;
    position: relative;
    background-color: #f8f8f8;
}

/* 优化视频元素样式 */
.posts-container .hover-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 优化图片样式 */
.post-cover-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* 优化帖子内容区域 */
.post-item h3 {
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-item p {
    padding: 0 1rem 1rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 优化帖子元信息样式 */
.post-item .post-meta {
    padding: 0 1rem 1rem 1rem;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    color: #888;
    font-size: 0.8rem;
    margin-top: auto;
}

/* 优化评论按钮 */
.comment-btn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}

.comment-btn:hover {
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .posts-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .posts-container .video-container,
    .post-cover-image {
        height: 200px;
    }
}